package com.woniuxy.consumer.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

/**
 * @Author: yangtao
 * @date 2021/8/2 16:49
 * @Version 1.0
 */
@RestController
@RequestMapping("/abc")
public class TestController {
    @Resource
    private RestTemplate restTemplate;

    @RequestMapping("/get")
    public int getPort(){
        return restTemplate.getForObject("http://PROVIDER/test/port",int.class);
    }
}
